/************************************************************************

								Heroes IV
					  Copyright 2000, The 3DO Company

	------------------------------------------------------------------
  						 quad.h

	$Header: /heroes4/quad.h $

	$NoKeywords: $

 ************************************************************************/

#if !defined( QUAD_H_INCLUDED )
#define QUAD_H_INCLUDED

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

// -------------------------------------------------------------------
// t_quad class template
// -------------------------------------------------------------------

template < typename t_elem >
class t_quad
{
public:
	// Data members
	t_elem	left;
	t_elem	top;
	t_elem	right;
	t_elem	bottom;

	// Constructors
	t_quad();
	t_quad( t_elem new_left, t_elem new_top, t_elem new_right, t_elem new_bottom );

	template < typename t_other_elem >
	t_quad( t_quad< t_other_elem > const & other )
		:	left( other.left ),
			top( other.top ),
			right( other.right ),
			bottom( other.bottom )
	{
	}

	t_quad( t_quad const & other );
};

template < typename t_elem >
inline t_quad< t_elem >::t_quad()
{
}

template < typename t_elem >
inline t_quad< t_elem >::t_quad( t_elem new_left, t_elem new_top, t_elem new_right, t_elem new_bottom )
	:	left( new_left ),
		top( new_top ),
		right( new_right ),
		bottom( new_bottom )
{
}

template < typename t_elem >
inline t_quad< t_elem >::t_quad( t_quad const & other )
	:	left( other.left ),
		top( other.top ),
		right( other.right ),
		bottom( other.bottom )
{
}

template < typename t_elem >
inline bool operator==( t_quad< t_elem > const & left, t_quad< t_elem > const & right )
{
	return left.left == right.left && left.top == right.top && left.right == right.right && left.bottom == right.bottom;
}

template < typename t_elem >
inline bool operator!=( t_quad< t_elem > const & left, t_quad< t_elem > const & right )
{
	return !( left == right );
}

#endif // !defined( QUAD_H_INCLUDED )
